#!/usr/bin/env python
# -*- coding: utf-8 -*-

__version__ = "0.1.0"

__copyright__ = """
    pyObjUtils - Object file library for Python.

   (C) 2010-2016 by Christoph Schueler <cpu12.gems@googlemail.com>

   All Rights Reserved

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation; either version 2 of the License, or
  (at your option) any later version.

  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.

  You should have received a copy of the GNU General Public License along
  with this program; if not, write to the Free Software Foundation, Inc.,
  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
"""

ATTRIBUTES_BY_TAG = {
    "DW_TAG_access_declaration": """DECL DW_AT_accessibility DW_AT_description DW_AT_name DW_AT_sibling""".split(),

    "DW_TAG_array_type": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_bit_size
        DW_AT_bit_stride DW_AT_byte_size DW_AT_data_location DW_AT_declaration DW_AT_description DW_AT_name DW_AT_ordering
        DW_AT_sibling DW_AT_specification DW_AT_start_scope DW_AT_type DW_AT_visibility""".split(),

    "DW_TAG_base_type": """DECL DW_AT_allocated DW_AT_associated DW_AT_binary_scale DW_AT_bit_offset DW_AT_bit_size DW_AT_byte_size
        DW_AT_data_bit_offset DW_AT_data_location DW_AT_decimal_scale DW_AT_decimal_sign DW_AT_description DW_AT_digit_count
        DW_AT_encoding DW_AT_endianity DW_AT_name DW_AT_picture_string DW_AT_sibling DW_AT_small""".split(),

    "DW_TAG_catch_block": """DECL DW_AT_abstract_origin DW_AT_high_pc DW_AT_low_pc DW_AT_ranges DW_AT_segment
        DW_AT_sibling""".split(),

    "DW_TAG_class_type" : """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_bit_size
        DW_AT_byte_size DW_AT_data_location DW_AT_declaration DW_AT_description DW_AT_name DW_AT_sibling DW_AT_signature
        DW_AT_specification DW_AT_start_scope DW_AT_visibility""".split(),

    "DW_TAG_common_block": """DECL DW_AT_declaration DW_AT_description DW_AT_linkage_name DW_AT_location DW_AT_name DW_AT_segment
        DW_AT_sibling DW_AT_visibility""".split(),

    "DW_TAG_common_inclusion": """DECL DW_AT_common_reference DW_AT_declaration DW_AT_sibling DW_AT_visibility""".split(),

    "DW_TAG_compile_unit": """DW_AT_base_types DW_AT_comp_dir DW_AT_identifier_case DW_AT_high_pc DW_AT_language DW_AT_low_pc
        DW_AT_macro_info DW_AT_main_subprogram DW_AT_name DW_AT_producer DW_AT_ranges DW_AT_segment DW_AT_stmt_list
        DW_AT_use_UTF8""".split(),

    "DW_TAG_condition": """DECL DW_AT_name DW_AT_sibling""".split(),

    "DW_TAG_const_type": """DW_AT_allocated DW_AT_associated DW_AT_data_location DW_AT_name DW_AT_sibling DW_AT_type""".split(),

    "DW_TAG_constant": """DECL DW_AT_accessibility DW_AT_const_value DW_AT_declaration DW_AT_description DW_AT_endianity
        DW_AT_external DW_AT_linkage_name DW_AT_name DW_AT_sibling DW_AT_start_scope DW_AT_type DW_AT_visibility""".split(),

    "DW_TAG_dwarf_procedure": "DW_AT_location",

    "DW_TAG_entry_point": """DECL DW_AT_address_class DW_AT_description DW_AT_frame_base DW_AT_linkage_name DW_AT_low_pc
        DW_AT_name DW_AT_return_addr DW_AT_segment DW_AT_sibling DW_AT_static_link DW_AT_type""".split(),

    "DW_TAG_enumeration_type": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_bit_size
        DW_AT_bit_stride DW_AT_byte_size DW_AT_byte_stride DW_AT_data_location DW_AT_declaration DW_AT_description DW_AT_enum_class
        DW_AT_name DW_AT_sibling DW_AT_signature DW_AT_specification DW_AT_start_scope DW_AT_type DW_AT_visibility""".split(),

    "DW_TAG_enumerator": """DECL DW_AT_const_value DW_AT_description DW_AT_name DW_AT_sibling""".split(),

    "DW_TAG_file_type": """DECL DW_AT_abstract_origin DW_AT_allocated DW_AT_associated DW_AT_bit_size DW_AT_byte_size
        DW_AT_data_location DW_AT_description DW_AT_name DW_AT_sibling DW_AT_start_scope DW_AT_type DW_AT_visibility""".split(),

    "DW_TAG_formal_parameter": """DECL DW_AT_abstract_origin DW_AT_artificial DW_AT_const_value DW_AT_default_value
        DW_AT_description DW_AT_endianity DW_AT_is_optional DW_AT_location DW_AT_name DW_AT_segment DW_AT_sibling DW_AT_type
        DW_AT_variable_parameter""".split(),

    "DW_TAG_friend": """DECL DW_AT_abstract_origin DW_AT_friend DW_AT_sibling""".split(),

    "DW_TAG_imported_declaration": """DECL DW_AT_accessibility DW_AT_description DW_AT_import DW_AT_name DW_AT_sibling
        DW_AT_start_scope""".split(),

    "DW_TAG_imported_module": """DECL DW_AT_import DW_AT_sibling DW_AT_start_scope""".split(),

    "DW_TAG_imported_unit": "DW_AT_import",

    "DW_TAG_inheritance": """DECL DW_AT_accessibility DW_AT_data_member_location DW_AT_sibling DW_AT_type
        DW_AT_virtuality""".split(),

    "DW_TAG_inlined_subroutine": """DW_AT_abstract_origin DW_AT_call_column DW_AT_call_file DW_AT_call_line DW_AT_const_expr
        DW_AT_entry_pc DW_AT_high_pc DW_AT_low_pc DW_AT_ranges DW_AT_return_addr DW_AT_segment DW_AT_sibling DW_AT_start_scope
        DW_AT_trampoline""".split(),

    "DW_TAG_interface_type": """DECL DW_AT_accessibility DW_AT_description DW_AT_name DW_AT_sibling DW_AT_start_scope""".split(),

    "DW_TAG_label": """DECL DW_AT_abstract_origin DW_AT_description DW_AT_low_pc DW_AT_name DW_AT_segment DW_AT_start_scope
        DW_AT_sibling""".split(),

    "DW_TAG_lexical_block": """DECL DW_AT_abstract_origin DW_AT_description DW_AT_high_pc DW_AT_low_pc DW_AT_name DW_AT_ranges
        DW_AT_segment DW_AT_sibling""".split(),

    "DW_TAG_member": """DECL DW_AT_accessibility DW_AT_bit_offset DW_AT_bit_size DW_AT_byte_size DW_AT_data_bit_offset
        DW_AT_data_member_location DW_AT_declaration DW_AT_description DW_AT_mutable DW_AT_name DW_AT_sibling DW_AT_type
        DW_AT_visibility""".split(),

    "DW_TAG_module": """DECL DW_AT_accessibility DW_AT_declaration DW_AT_description DW_AT_entry_pc DW_AT_high_pc DW_AT_low_pc
        DW_AT_name DW_AT_priority DW_AT_ranges DW_AT_segment DW_AT_sibling DW_AT_specification DW_AT_visibility""".split(),

    "DW_TAG_namelist": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_declaration DW_AT_name DW_AT_sibling
        DW_AT_visibility""".split(),

    "DW_TAG_namelist_item": """DECL DW_AT_namelist_item DW_AT_sibling""".split(),

    "DW_TAG_namespace": """DECL DW_AT_description DW_AT_extension DW_AT_name DW_AT_sibling DW_AT_start_scope""".split(),

    "DW_TAG_packed_type": """DW_AT_allocated DW_AT_associated DW_AT_data_location DW_AT_name DW_AT_sibling DW_AT_type""".split(),

    "DW_TAG_partial_unit": """DW_AT_base_types DW_AT_comp_dir DW_AT_description DW_AT_identifier_case DW_AT_high_pc DW_AT_language
        DW_AT_low_pc DW_AT_macro_info DW_AT_main_subprogram DW_AT_name DW_AT_producer DW_AT_ranges DW_AT_segment DW_AT_stmt_list
        DW_AT_use_UTF8""".split(),

    "DW_TAG_pointer_type": """DW_AT_address_class DW_AT_allocated DW_AT_associated DW_AT_data_location DW_AT_name DW_AT_sibling
        DW_AT_type""".split(),

    "DW_TAG_ptr_to_member_type": """DECL DW_AT_abstract_origin DW_AT_address_class DW_AT_allocated DW_AT_associated
        DW_AT_containing_type DW_AT_data_location DW_AT_declaration DW_AT_description DW_AT_name DW_AT_sibling DW_AT_type
        DW_AT_use_location DW_AT_visibility""".split(),

    "DW_TAG_reference_type": """DW_AT_address_class DW_AT_allocated DW_AT_associated DW_AT_data_location DW_AT_name DW_AT_sibling
        DW_AT_type """.split(),

    "DW_TAG_restrict_type": """DW_AT_allocated DW_AT_associated DW_AT_data_location DW_AT_name DW_AT_sibling DW_AT_type""".split(),

    "DW_TAG_rvalue_reference_type": """DECL DW_AT_address_class DW_AT_allocated DW_AT_associated DW_AT_data_location DW_AT_name
        DW_AT_sibling DW_AT_type""".split(),

    "DW_TAG_set_type": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_bit_size
        DW_AT_byte_size DW_AT_data_location DW_AT_declaration DW_AT_description DW_AT_name DW_AT_start_scope DW_AT_sibling
        DW_AT_type DW_AT_visibility""".split(),

    "DW_TAG_shared_type": """DW_AT_allocated DW_AT_associated DW_AT_count DW_AT_data_location DW_AT_name DW_AT_sibling
        DW_AT_type""".split(),

    "DW_TAG_string_type": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_bit_size
        DW_AT_byte_size DW_AT_data_location DW_AT_declaration DW_AT_description DW_AT_name DW_AT_sibling DW_AT_start_scope
        DW_AT_string_length DW_AT_visibility""".split(),

    "DW_TAG_structure_type": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_bit_size
        DW_AT_byte_size DW_AT_data_location DW_AT_declaration DW_AT_description DW_AT_name DW_AT_sibling DW_AT_signature
        DW_AT_specification DW_AT_start_scope DW_AT_visibility""".split(),

    "DW_TAG_subprogram": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_address_class DW_AT_artificial
        DW_AT_calling_convention DW_AT_declaration DW_AT_description DW_AT_elemental DW_AT_entry_pc DW_AT_explicit DW_AT_external
        DW_AT_frame_base DW_AT_high_pc DW_AT_inline DW_AT_linkage_name DW_AT_low_pc DW_AT_main_subprogram DW_AT_name
        DW_AT_object_pointer DW_AT_prototyped DW_AT_pure DW_AT_ranges DW_AT_recursive DW_AT_return_addr DW_AT_segment DW_AT_sibling
        DW_AT_specification DW_AT_start_scope DW_AT_static_link DW_AT_trampoline DW_AT_type DW_AT_visibility DW_AT_virtuality
        DW_AT_vtable_elem_location""".split(),

    "DW_TAG_subrange_type": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_bit_size
        DW_AT_bit_stride DW_AT_byte_size DW_AT_byte_stride DW_AT_count DW_AT_data_location DW_AT_declaration DW_AT_description
        DW_AT_lower_bound DW_AT_name DW_AT_sibling DW_AT_threads_scaled DW_AT_type DW_AT_upper_bound DW_AT_visibility""".strip(),

    "DW_TAG_subroutine_type": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_address_class DW_AT_allocated
        DW_AT_associated DW_AT_data_location DW_AT_declaration DW_AT_description DW_AT_name DW_AT_prototyped DW_AT_sibling
        DW_AT_start_scope DW_AT_type DW_AT_visibility""".strip(),

    "DW_TAG_template_alias": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_data_location
        DW_AT_declaration DW_AT_description DW_AT_name DW_AT_sibling DW_AT_signature DW_AT_start_scope DW_AT_type
        DW_AT_visibility""".split(),

    "DW_TAG_template_type_parameter": """DECL DW_AT_description DW_AT_name DW_AT_sibling DW_AT_type""".split(),

    "DW_TAG_template_value_parameter": """DECL DW_AT_const_value DW_AT_description DW_AT_name DW_AT_sibling DW_AT_type""".split(),

    "DW_TAG_thrown_type": """DECL DW_AT_allocated DW_AT_associated DW_AT_data_location DW_AT_sibling DW_AT_type""".split(),

    "DW_TAG_try_block": """DECL DW_AT_abstract_origin DW_AT_high_pc DW_AT_low_pc DW_AT_ranges DW_AT_segment
        DW_AT_sibling""".split(),

    "DW_TAG_typedef": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_data_location
        DW_AT_declaration DW_AT_description DW_AT_name DW_AT_sibling DW_AT_start_scope DW_AT_type DW_AT_visibility""".split(),

    "DW_TAG_type_unit": "DW_AT_language",

    "DW_TAG_union_type": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_allocated DW_AT_associated DW_AT_bit_size
        DW_AT_byte_size DW_AT_data_location DW_AT_declaration DW_AT_description DW_AT_name DW_AT_sibling DW_AT_signature
        DW_AT_specification DW_AT_start_scope DW_AT_visibility""".split(),

    "DW_TAG_unspecified_parameters": """DECL DW_AT_abstract_origin DW_AT_artificial DW_AT_sibling""".split(),

    "DW_TAG_unspecified_type": """DECL DW_AT_description DW_AT_name""".split(),

    "DW_TAG_variable": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_const_expr DW_AT_const_value DW_AT_declaration
        DW_AT_description DW_AT_endianity DW_AT_external DW_AT_linkage_name DW_AT_location DW_AT_name DW_AT_segment DW_AT_sibling
        DW_AT_specification DW_AT_start_scope DW_AT_type DW_AT_visibility""".split(),

    "DW_TAG_variant": """DECL DW_AT_accessibility DW_AT_abstract_origin DW_AT_declaration DW_AT_discr_list DW_AT_discr_value
        DW_AT_sibling""".split(),

    "DW_TAG_variant_part": """DECL DW_AT_abstract_origin DW_AT_accessibility DW_AT_declaration DW_AT_discr DW_AT_sibling
        DW_AT_type""".split(),

    "DW_TAG_volatile_type": """DW_AT_allocated DW_AT_associated DW_AT_data_location DW_AT_name DW_AT_sibling DW_AT_type""".split(),

    "DW_TAG_with_stmt": """DW_AT_accessibility DW_AT_address_class DW_AT_declaration DW_AT_high_pc DW_AT_location DW_AT_low_pc
        DW_AT_ranges DW_AT_segment DW_AT_sibling DW_AT_type DW_AT_visibility""".split(),
}

